//
//  RDChapterModel.m
//  eCourseApp
//
//  Created by 飞猪 on 2018/8/26.
//  Copyright © 2018年 Facebook. All rights reserved.
//

#import "RDChapterModel.h"

@implementation RDChapterModel

- (void)encodeWithCoder:(NSCoder *)aCoder {
  
   [aCoder encodeObject:self.path forKey:@"path"];
  
  
  [aCoder encodeObject:self.chId forKey:@"Id"];
  [aCoder encodeObject:self.chName forKey:@"Name"];
  [aCoder encodeObject:self.chContent forKey:@"Content"];
  [aCoder encodeObject:self.chCharge forKey:@"Charge"];
  
  [aCoder encodeObject:self.nextChId forKey:@"nextChId"];
  [aCoder encodeObject:self.nextChCharge forKey:@"nextChCharge"];
  [aCoder encodeObject:self.preChId forKey:@"preChId"];
  [aCoder encodeObject:self.preChCharge forKey:@"preChCharge"];
  
  [aCoder encodeObject:self.bookId forKey:@"bookId"];
  
  [aCoder encodeObject:self.curPage forKey:@"curPage"];
}

- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
  if (self = [super init]) {
    self.path = [aDecoder decodeObjectForKey:@"path"] ;
    
    self.chId = [aDecoder decodeObjectForKey:@"Id"];
    self.chName = [aDecoder decodeObjectForKey:@"Name"];
    
    self.chContent = [aDecoder decodeObjectForKey:@"Content"] ;
    self.chCharge = [aDecoder decodeObjectForKey:@"Charge"];
    
    self.nextChId = [aDecoder decodeObjectForKey:@"nextChId"] ;
    self.nextChCharge = [aDecoder decodeObjectForKey:@"nextChCharge"];
    
    self.preChId = [aDecoder decodeObjectForKey:@"preChId"] ;
    self.preChCharge = [aDecoder decodeObjectForKey:@"preChCharge"];
    
    self.bookId = [aDecoder decodeObjectForKey:@"bookId"];
    
    self.curPage = [aDecoder decodeObjectForKey:@"curPage"];
  }
  return self;
}

@end
